{include file='header'/}
<body class="pear-admin">
<form class="layui-form" action="{:url('auth_rule/add')}">
    <div class="mainBox">
        <div class="main-container">
            <div class="layui-form-item">
                <label class="layui-form-label required">所属上级</label>
                <div class="layui-input-inline">
                    <select name="pid" lay-verify="" lay-search>
                        <?php
                        foreach($pidList as $key=>$v){
                        ?>
                        <option value="<?php echo $v['id'] ?>"
                        <?php if($v['id'] == $id) echo "selected"; ?>><?php echo $v['title'] ?></option>
                        <?php } ?>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">权限类型</label>
                <div class="layui-input-inline">
                    <select name="type" lay-verify="" lay-search>
                        <option value="0" selected>目录</option>
                        <option value="1">页面</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">是否菜单</label>
                <div class="layui-input-block">
                    <input type="radio" name="is_menu" value="1" title="是">
                    <input type="radio" name="is_menu" value="0" title="否" checked>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">权限图标</label>
                <div class="layui-input-block">
                    <input type="text" name="icon" id="iconPicker2" value="" lay-filter="iconPicker2">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">权限名称【英文】</label>
                <div class="layui-input-block">
                    <div class="layui-input-group">
                        <input type="text" name="title_en" placeholder="请输入英文的菜单名称" class="layui-input"
                               value="" lay-verify="required">
                        <div class="layui-input-suffix" style="color:#1e9fff">
                            <i class="layui-icon layui-icon-tips"  style="color:#1e9fff"></i>【语言：英文，这里作为多语言key】
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">权限名称【简体】</label>
                <div class="layui-input-block">
                    <div class="layui-input-group">
                        <input type="text" name="title" placeholder="请输入简体中文的菜单名称" class="layui-input"
                               value="" lay-verify="required" >
                        <div class="layui-input-suffix" style="color:#1e9fff">
                            <i class="layui-icon layui-icon-tips"  style="color:#1e9fff"></i>【语言：简体中文】
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">权限名称【繁体】</label>
                <div class="layui-input-block">
                    <div class="layui-input-group">
                        <input type="text" name="title_hk" placeholder="请输入繁体中文的菜单名称" class="layui-input"
                               value="" lay-verify="required">
                        <div class="layui-input-suffix" style="color:#1e9fff">
                            <i class="layui-icon layui-icon-tips"  style="color:#1e9fff"></i>【语言：繁体中文】
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">权限地址</label>
                <div class="layui-input-block">
                    <input type="text" name="node" id="node" lay-verify="required" autocomplete="off"
                           placeholder="请输入权限路径地址"
                           class="layui-input" value="">
                </div>
                <tip>请填写完整的路径地址，如：admin/content/init</tip>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">权限排序</label>
                <div class="layui-input-inline">
                    <input type="number" name="sort" id="sort" lay-verify="required" autocomplete="off"
                           placeholder="请输入菜单排序"
                           class="layui-input" value="100">
                    <tip>【越小越靠前】</tip>
                </div>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <input type="hidden" name="__token__" value="{:token()}" />
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                    lay-filter="admin-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="pear-btn pear-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
{include file='footer'/}
<script>
  layui.use(['form', 'jquery', 'iconPicker'], function () {
    let form = layui.form;
    let $ = layui.jquery;
    let iconPicker = layui.iconPicker;

    iconPicker.render({
      elem: '#iconPicker2',
      type: 'fontClass',
      style: 'color: #5FB878;',
      placeholder: '',
      isSplit: true,
      search: true,
      page: false,
      limit: 16,
      click: function (data) {
        //console.log(data);
      },
      success: function (d) {
        //console.log(d);
      }
      , ready: function () {
      }
    });
  })
</script>
